{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";\nimport _createClass from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createClass.js\";\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nvar CancelToken = /*#__PURE__*/function () {\n  function CancelToken(executor) {\n    _classCallCheck(this, CancelToken);\n    if (typeof executor !== 'function') {\n      throw new TypeError('executor must be a function.');\n    }\n    var resolvePromise;\n    this.promise = new Promise(function promiseExecutor(resolve) {\n      resolvePromise = resolve;\n    });\n    var token = this;\n\n    // eslint-disable-next-line func-names\n    this.promise.then(function (cancel) {\n      if (!token._listeners) return;\n      var i = token._listeners.length;\n      while (i-- > 0) {\n        token._listeners[i](cancel);\n      }\n      token._listeners = null;\n    });\n\n    // eslint-disable-next-line func-names\n    this.promise.then = function (onfulfilled) {\n      var _resolve;\n      // eslint-disable-next-line func-names\n      var promise = new Promise(function (resolve) {\n        token.subscribe(resolve);\n        _resolve = resolve;\n      }).then(onfulfilled);\n      promise.cancel = function reject() {\n        token.unsubscribe(_resolve);\n      };\n      return promise;\n    };\n    executor(function cancel(message, config, request) {\n      if (token.reason) {\n        // Cancellation has already been requested\n        return;\n      }\n      token.reason = new CanceledError(message, config, request);\n      resolvePromise(token.reason);\n    });\n  }\n\n  /**\n   * Throws a `CanceledError` if cancellation has been requested.\n   */\n  _createClass(CancelToken, [{\n    key: \"throwIfRequested\",\n    value: function throwIfRequested() {\n      if (this.reason) {\n        throw this.reason;\n      }\n    }\n\n    /**\n     * Subscribe to the cancel signal\n     */\n  }, {\n    key: \"subscribe\",\n    value: function subscribe(listener) {\n      if (this.reason) {\n        listener(this.reason);\n        return;\n      }\n      if (this._listeners) {\n        this._listeners.push(listener);\n      } else {\n        this._listeners = [listener];\n      }\n    }\n\n    /**\n     * Unsubscribe from the cancel signal\n     */\n  }, {\n    key: \"unsubscribe\",\n    value: function unsubscribe(listener) {\n      if (!this._listeners) {\n        return;\n      }\n      var index = this._listeners.indexOf(listener);\n      if (index !== -1) {\n        this._listeners.splice(index, 1);\n      }\n    }\n\n    /**\n     * Returns an object that contains a new `CancelToken` and a function that, when called,\n     * cancels the `CancelToken`.\n     */\n  }], [{\n    key: \"source\",\n    value: function source() {\n      var cancel;\n      var token = new CancelToken(function executor(c) {\n        cancel = c;\n      });\n      return {\n        token: token,\n        cancel: cancel\n      };\n    }\n  }]);\n  return CancelToken;\n}();\nexport default CancelToken;","map":{"version":3,"names":["CanceledError","CancelToken","executor","TypeError","resolvePromise","promise","Promise","promiseExecutor","resolve","token","then","cancel","_listeners","i","length","onfulfilled","_resolve","subscribe","reject","unsubscribe","message","config","request","reason","listener","push","index","indexOf","splice","c"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/axios/lib/cancel/CancelToken.js"],"sourcesContent":["'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n  constructor(executor) {\n    if (typeof executor !== 'function') {\n      throw new TypeError('executor must be a function.');\n    }\n\n    let resolvePromise;\n\n    this.promise = new Promise(function promiseExecutor(resolve) {\n      resolvePromise = resolve;\n    });\n\n    const token = this;\n\n    // eslint-disable-next-line func-names\n    this.promise.then(cancel => {\n      if (!token._listeners) return;\n\n      let i = token._listeners.length;\n\n      while (i-- > 0) {\n        token._listeners[i](cancel);\n      }\n      token._listeners = null;\n    });\n\n    // eslint-disable-next-line func-names\n    this.promise.then = onfulfilled => {\n      let _resolve;\n      // eslint-disable-next-line func-names\n      const promise = new Promise(resolve => {\n        token.subscribe(resolve);\n        _resolve = resolve;\n      }).then(onfulfilled);\n\n      promise.cancel = function reject() {\n        token.unsubscribe(_resolve);\n      };\n\n      return promise;\n    };\n\n    executor(function cancel(message, config, request) {\n      if (token.reason) {\n        // Cancellation has already been requested\n        return;\n      }\n\n      token.reason = new CanceledError(message, config, request);\n      resolvePromise(token.reason);\n    });\n  }\n\n  /**\n   * Throws a `CanceledError` if cancellation has been requested.\n   */\n  throwIfRequested() {\n    if (this.reason) {\n      throw this.reason;\n    }\n  }\n\n  /**\n   * Subscribe to the cancel signal\n   */\n\n  subscribe(listener) {\n    if (this.reason) {\n      listener(this.reason);\n      return;\n    }\n\n    if (this._listeners) {\n      this._listeners.push(listener);\n    } else {\n      this._listeners = [listener];\n    }\n  }\n\n  /**\n   * Unsubscribe from the cancel signal\n   */\n\n  unsubscribe(listener) {\n    if (!this._listeners) {\n      return;\n    }\n    const index = this._listeners.indexOf(listener);\n    if (index !== -1) {\n      this._listeners.splice(index, 1);\n    }\n  }\n\n  /**\n   * Returns an object that contains a new `CancelToken` and a function that, when called,\n   * cancels the `CancelToken`.\n   */\n  static source() {\n    let cancel;\n    const token = new CancelToken(function executor(c) {\n      cancel = c;\n    });\n    return {\n      token,\n      cancel\n    };\n  }\n}\n\nexport default CancelToken;\n"],"mappings":"AAAA,YAAY;;AAAC;AAAA;AAEb,OAAOA,aAAa,MAAM,oBAAoB;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOMC,WAAW;EACf,qBAAYC,QAAQ,EAAE;IAAA;IACpB,IAAI,OAAOA,QAAQ,KAAK,UAAU,EAAE;MAClC,MAAM,IAAIC,SAAS,CAAC,8BAA8B,CAAC;IACrD;IAEA,IAAIC,cAAc;IAElB,IAAI,CAACC,OAAO,GAAG,IAAIC,OAAO,CAAC,SAASC,eAAe,CAACC,OAAO,EAAE;MAC3DJ,cAAc,GAAGI,OAAO;IAC1B,CAAC,CAAC;IAEF,IAAMC,KAAK,GAAG,IAAI;;IAElB;IACA,IAAI,CAACJ,OAAO,CAACK,IAAI,CAAC,UAAAC,MAAM,EAAI;MAC1B,IAA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